<?php
/**
 * Created by PhpStorm.
 * User: adophper <hello@adophper.com>
 * Date: 2018/3/20
 * Time: 11:12
 */
use frontend\widgets\HeaderMenu;
use common\models\UserCompany;
if (!Yii::$app->user->isGuest) {
    $userId = Yii::$app->user->getId();
    $userCompany = UserCompany::findOne(['user_id' => $userId]);
}
?>
<!--页面头部-->
<div class="headBox">
    <div class="headSty">
        <div class="headSty_min">
            <div class="contBox headSty_min_box flex f_end">
                <?php
                if (Yii::$app->user->isGuest) {
                ?>
                <a href="<?=Yii::$app->urlManager->createUrl(['member/login']) ?>" title="登录"><i class="iconfont point">&#xe614;</i></a>
                <a href="<?=Yii::$app->urlManager->createUrl(['member/register']) ?>" title="注册"><i class="iconfont point">&#xe645;</i></a>
                <?php
                }else{
                ?>
                <a href="<?=Yii::$app->urlManager->createUrl(['member/index']) ?>" title="会员中心"><i class="iconfont point">&#xe641;</i></a>
                <?php
                if (empty($userCompany)) {
                ?>
                <a href="<?=Yii::$app->urlManager->createUrl(['member/zhubanfang']) ?>" title="会展主办方">会展主办方</a>
                <i>|</i>
                <a href="<?=Yii::$app->urlManager->createUrl(['member/canzhanshang']) ?>" title="会展参展商">会展参展商</a>
                <i>|</i>
                <a href="<?=Yii::$app->urlManager->createUrl(['member/fuwushang']) ?>" title="会展服务外包">会展服务外包</a>
                <i>|</i>
                <?php
                }else {
                    if ($userCompany->type == UserCompany::COMPANY_TYPE_Z){
                    ?>
                    <a href="<?=Yii::$app->urlManager->createUrl(['member/zhubanfang']) ?>" title="会展主办方">会展主办方</a>
                    <i>|</i>
                    <?php
                    }elseif ($userCompany->type == UserCompany::COMPANY_TYPE_C) {
                    ?>
                    <a href="<?=Yii::$app->urlManager->createUrl(['member/canzhanshang']) ?>" title="会展参展商">会展参展商</a>
                    <i>|</i>
                    <?php
                    }elseif ($userCompany->type == UserCompany::COMPANY_TYPE_F) {
                    ?>
                    <a href="<?=Yii::$app->urlManager->createUrl(['member/fuwushang']) ?>" title="会展服务外包">会展服务外包</a>
                    <i>|</i>
                    <?php
                    }
                }
                ?>
                <a href="<?=Yii::$app->urlManager->createUrl(['member/logout']) ?>" title="退出"><i>退出</i></a>
                <?php
                }
                ?>
                <i>|</i>
                <a href="javascript:;"><i>商城</i></a>
            </div>
        </div>
        <?=HeaderMenu::widget()?>
    </div>
</div>
